﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteMaster.Master"
    Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<%@ Import Namespace="Microhard.Framework.MVCHelper" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    项目管理
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="section-header">
        <div class="title">
            <img src="<%=Url.Content("~/Content/images/ico-catalog.png")%>" alt="" />
            项目管理
        </div>
        <div class="options">
        </div>
    </div>
    <table width="100%">
        <tr>
            <td class="adminTitle">
                <img alt="项目名称" src="<%=Url.Content("~/Content/images/ico-help.gif") %>" title="项目名称"></img><label
                    for="operationName" title="项目名称">项目名称</label>:
            </td>
            <td class="adminData">
                <%=Html.TextBox("searchForPrjName") %>
            </td>
        </tr>
    </table>
    <p>
    </p>
    <table class="adminContent">
        <tr>
            <td>
                <%Html.Telerik().Grid<Microhard.WarehouseInsp.Buz.Models.SupProjectModel>((List<Microhard.WarehouseInsp.Buz.Models.SupProjectModel>)this.Model.Data)
                    .Name("operation-grid")
                    .HtmlAttributes(new { height = "500" })
                    .ToolBar(t => t.Template(g =>
                    { %>
                <%var searchParms = new Dictionary<string, string>();
                  searchParms.Add("Name", "searchForPrjName");
                %>
                <div class="header-menu">
                    <ul class="t-widget t-reset t-header t-menu">
                        <li class="t-item  t-state-default">
                            <%=Html.Authorized_SearchButton("btnSearch", "查询", "operation-grid", searchParms, "OperationGridOnGridDataBinding")%>
                        </li>
                        <li class="t-item  t-state-default">
                            <%=Html.Authorized_AddButton("btnAdd", "添加", "Create", "SupProject")%>
                        </li>
                        <li class="t-item  t-state-default">
                            <%=Html.Authorized_UpdateButton("btnUpdate", "修改", "operation-grid", "Update", "SupProject", "WarehouseInsp")%>
                        </li>
                        <li class="t-item  t-state-default">
                            <%=Html.Authorized_DeleteButton("btnDelete", "删除", "operation-grid", "Delete", "SupProject", "WarehouseInsp")%>
                        </li>
                    </ul>
                </div>
                <%}))
                         .ClientEvents(events => events.OnDataBinding("OperationGridOnGridDataBinding"))
                         .Columns(columns =>
                    {
                        columns.Bound(x => x.ProjectID)
                       .Template(x => Html.CheckBox("checkedRecords", new { value = x.ProjectID, @class = "gridCks" }))
                       .ClientTemplate("<input type='checkbox' name='checkedRecords' value='<#= ProjectID #>' class='gridCks'/>")
                     .HtmlAttributes(new { style = "text-align:center" }).Title("选择");
                        columns.Template(x => {%>
                <a href="#" onclick="winViewPrjDetail_ShowDetail(this)" id="<%=x.ProjectID%>">
                    <%=x.Name %></a>
                <% }).ClientTemplate("<a href='#' id='<#=ProjectID#>' onclick='winViewPrjDetail_ShowDetail(this)'><#=Name #></a>").Title("项目名称");
                        columns.Bound(x => x.Code).Title("编号");
                        columns.Bound(x => x.StartEndDate).Title("开始结束时间");
                        columns.Bound(x => x.PMName).Title("数据中心专员");
                        columns.Bound(x => x.ProtalEmpName).Title("巡检员");
                        columns.Bound(x => x.BorrowerName).Title("借款人");
                        columns.Bound(x => x.MortgagorName).Title("出质人");
                        columns.Bound(x => x.CreateTime).Title("创建时间");
                        columns.Bound(x => x.StatusDisplay).Title("状态");
                        columns.Bound(x => x.ApproverName).Title("审批人");
                    })
                      .Pageable(settings => settings.Total(Model.Total).PageSize(Html.GetGridPageSize()).Position(GridPagerPosition.Top))
                      //绑定搜索按钮，执行对应的action
                    .DataBinding(dataBinding => dataBinding.Ajax().Select("_List", "SupProject"))
                    .EnableCustomBinding(true)
                    .Scrollable(s => s.Height(600))
                    .Render();
                %>
            </td>
        </tr>
    </table>
    <%Html.RenderPartial("ViewDetailCtr", new Microhard.WarehouseInsp.WebUI.Models.ViewDetailCtrModel
      {
          ActionName = "_AjaxViewDetail",
          AreaName = "WarehouseInsp",
          ControllerName = "SupProject",
          CtrID = "winViewPrjDetail",
          WinWidth = 1100,
          WinHeight = 700
      }); %>
</asp:Content>
